package com.ly.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.system.mapper.UserEducationalMapper;
import com.ly.system.service.IUserEducationalService;
import org.springframework.stereotype.Service;
import com.ly.common.core.domain.entity.UserEducationalEntity;

import javax.annotation.Resource;


/**
 * 用户教育经历Service业务层处理
 * @author wutao
 * @date 2024-05-29
 */
@Service
public class UserEducationalServiceImpl extends ServiceImpl<UserEducationalMapper, UserEducationalEntity> implements IUserEducationalService {

    @Resource
    private UserEducationalMapper userEducationalEntityMapper;

    /**
     * 查询用户教育经历
     * @param id 用户教育经历ID
     * @return 用户教育经历
     */
    @Override
    public UserEducationalEntity selectUserEducationalEntityById (String id) {
        return userEducationalEntityMapper.selectUserEducationalEntityById ( id );
    }

    /**
     * 查询用户教育经历列表
     * @param userEducationalEntity 用户教育经历
     * @return 用户教育经历
     */
    @Override
    public List<UserEducationalEntity> selectUserEducationalEntityList (UserEducationalEntity userEducationalEntity) {
        return userEducationalEntityMapper.selectUserEducationalEntityList ( userEducationalEntity );
    }

    /**
     * 新增用户教育经历
     * @param userEducationalEntity 用户教育经历
     * @return 结果
     */
    @Override
    public int insertUserEducationalEntity (UserEducationalEntity userEducationalEntity) {
        userEducationalEntity.setId ( SnowflakeIdWorker.getInstance ().nextStringId () );
        userEducationalEntity.setCreateTime ( DateUtils.getNowDate () );
        return userEducationalEntityMapper.insertUserEducationalEntity ( userEducationalEntity );
    }

    /**
     * 修改用户教育经历
     * @param userEducationalEntity 用户教育经历
     * @return 结果
     */
    @Override
    public int updateUserEducationalEntity (UserEducationalEntity userEducationalEntity) {
        userEducationalEntity.setUpdateTime ( DateUtils.getNowDate () );
        return userEducationalEntityMapper.updateUserEducationalEntity ( userEducationalEntity );
    }

    /**
     * 批量删除用户教育经历
     * @param ids 需要删除的用户教育经历ID
     * @return 结果
     */
    @Override
    public int deleteUserEducationalEntityByIds (String[] ids) {
        return userEducationalEntityMapper.deleteUserEducationalEntityByIds ( ids );
    }

    /**
     * 删除用户教育经历信息
     * @param id 用户教育经历ID
     * @return 结果
     */
    @Override
    public int deleteUserEducationalEntityById (String id) {
        return userEducationalEntityMapper.deleteUserEducationalEntityById ( id );
    }
}
